<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "admin_user".
 *
 * @property int $id
 * @property int $superior_id 上级管理员ID
 * @property string $username 用户
 * @property string $password 密码
 * @property string $Jurisdiction_1 一级权限
 * @property string $Jurisdiction_2 二级权限
 * @property int $grade 0 admin超级管理员 1 渠道超级管理员 2 管理员
 */
class AdminUser extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'admin_user';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['superior_id', 'grade'], 'integer'],
            [['username', 'password'], 'string', 'max' => 64],
            [['Jurisdiction_1', 'Jurisdiction_2'], 'string', 'max' => 500],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'superior_id' => 'Superior ID',
            'username' => 'Username',
            'password' => 'Password',
            'Jurisdiction_1' => 'Jurisdiction 1',
            'Jurisdiction_2' => 'Jurisdiction 2',
            'grade' => 'Grade',
        ];
    }
}
